/**
 * 主题过滤器订阅数TOP3柱状图
 * @param data
 */
export function getTopicFilterSubscriberCntTopOption(topicFilterSubscriberCntTop) {
  let topicFilters = []
  let topicFilterSubscriberCntTopVals = []
  for (let i = 0; i < topicFilterSubscriberCntTop.length; i++) {
    topicFilters[i] = topicFilterSubscriberCntTop[i].topicFilter
    topicFilterSubscriberCntTopVals[i] = topicFilterSubscriberCntTop[i].cnt
  }
  let option = {
    title: {
      text: '主题过滤器订阅数TOP3',
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: {            // 坐标轴指示器，坐标轴触发有效
        type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
      }
    },
    xAxis: {
      type: 'value'
    },
    yAxis: {
      type: 'category',
      data: topicFilters
    },
    series: [{
      data: topicFilterSubscriberCntTopVals,
      type: 'bar'
    }]
  }

  return option
}
